
import { createRouter, createWebHistory } from 'vue-router'
import type {RouteRecordRaw} from 'vue-router'
export const MEOU_ROUTE:RouteRecordRaw[] = [
  {
    path: '/home',
    meta:{
      title:'首页'
    },
    component: () => import('@/views/home/index.vue')
  },
  {
    path: '/echars',
    meta:{
      title:'图表'
    },
    component: () => import('@/views/echars/index.vue')
  },
  {
    path:'/list',
    meta:{
      title:'列表',
    },
    children:[
      {
        path:'/list/manage',
        meta:{
          title:'列表管理'
        },
        component: () => import('@/views/listmanage/index.vue')
      },
      {
        path:'/list/there',
        meta:{
          title:'列表3级'
        },
        children:[
          {
            path:'/list/there/add',
            meta:{
              title:'列表3级'
            },
            component: () => import('@/views/listadd/index.vue')
          }
        ]
      }
    ]
  },
   {
    path: '/set',
    meta:{
      title:'设置'
    },
    component: () => import('@/views/set/index.vue')
  }
]
const ROOT_ROUTE:RouteRecordRaw[] = [
  {
    path: '/login',
    meta:{
      title:'登录'
    },
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/',
     meta:{
      title:'主页'
    },
    //重定向
    redirect:'/home',
    component: () => import('@/views/layout/index.vue'),
    children:MEOU_ROUTE
  }
]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes:ROOT_ROUTE
})

export default router
